#include <iostream>
#include <assert.h>
#include<string>
namespace zq
{
    template <class T>
    class my_vector
    {
    public:
        typedef T *iterator;
        typedef const T *const_iterator;
        // 迭代器的实现
        iterator begin();

        iterator end();
        const_iterator begin() const;
        const_iterator end() const;

        my_vector();

        void reserve(size_t n);
        void push_back(const T &x);

        void insert(iterator pos, const T &x);

        void pop_back();

        // 删除后会返回下一个位置的迭代器
        iterator erase(iterator pos);
        void resize(size_t n, const T &val = T());

        // 拷贝构造 v2(v)
        my_vector(const my_vector<int> &v);

        // 现代写法的赋值v2 = v
        my_vector<T> &operator=(my_vector<T> v);

        size_t size();
        size_t capacity();

        size_t size() const;
        size_t capacity() const;

        void print_vector();
        ~my_vector();

    private:
        iterator _start;
        iterator _finish;
        iterator _end_of_storage;
    };
}